import http from '@/utils/requset'
import { nav } from '@/types/user'

//新增导航
export const setUserMenuList = (data: nav) => {
    return http.request({
        url: '/basic/setUserMenuList',
        method: 'POST',
        data
    })
}
//获取导航
export const getUserMenuList = (value?: any, auth?: any) => {
    return http.request({
        url: '/basic/getUserMenuList',
        method: 'GET',
        params: {
            searchValue: value,
            auth: auth
        }
    })
}
////删除
export const delUserMenuList = (id: number | string) => {
    console.log(id)
    return http.request({
        url: '/basic/delUserMenuList',
        method: 'DELETE',
        data: {
            id
        }
    })
}
// 获取id
export const getNavigationId = () => {
    return http.request({
        url: '/basic/getNavigationId',
        method: 'GET'
    })
}
//获取数据字典
export const dictionary = (params?: any) => {
    return http.request({
        url: '/common/dictionary',
        method: 'GET',
        params: params
    })
}
//新增
export const updateDictionary = (data: nav) => {
    return http.request({
        url: '/common/updateDictionary',
        method: 'POST',
        data
    })
}
//删除
export const DelDictionary = (id: number | string) => {
    return http.request({
        url: '/common/DelDictionary',
        method: 'DELETE',
        data: {
            id
        }
    })
}

//表单相关
export const getCustomFrom = (params?: any) => {
    return http.request({
        url: '/basic/getCustomFrom',
        method: 'GET',
        params: params
    })
}
export const setCustomFrom = (data: any) => {
    return http.request({
        url: '/basic/setCustomFrom',
        method: 'POST',
        data: data
    })
}
//删除
export const delCustomFrom = (id: number | string) => {
    return http.request({
        url: '/basic/delCustomFrom',
        method: 'DELETE',
        data: {
            id
        }
    })
}